// 引入变量和全局样式
@use "var.scss" as *;
@use "global.scss" as *;
.content-list {
    min-height: 18rem;
    padding: 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* 将子项水平居中 */
    .section-content {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        /* 将子项水平居中 */
    }
    .content-item {
        width: calc(40% - 1.25rem);
        /* 设置子项宽度，减去外边距 */
        margin: 0.6rem 2rem;
        /* 为了在子项之间创建间距 */
        border-radius: 0.25rem;
        position: relative;
        height: 15rem;
        border-radius: 1rem;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        @media screen and (max-width: 768px) {
            width: 100%;
            /* 移动端每行只显示一个，宽度 100% */
            margin: 1rem;
            /* 使用相对单位 rem */
            max-height: 30rem;
            /* 设置最大高度 */
        }
    }
}

/* 添加鼠标移入时的翻转效果 */

.content-item {
    perspective: 66rem;
    transform-style: preserve-3d;
}

/* 给menu-container添加翻转效果  */

.content-item:hover .menu-container {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
}

.menu-container {
    transform-style: preserve-3d;
    position: relative;
    width: 100%;
    height: 100%;
    -webkit-transition: transform ease-in-out 0.6s;
    -moz-transition: transform ease-in-out 0.6s;
    -ms-transition: transform ease-in-out 0.6s;
    -o-transition: transform ease-in-out 0.6s;
    transition: transform ease-in-out 0.6s;
}

.menu-image,
.menu-container > div {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.inner-container {
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    /* 初始状态翻转180度，只显示反面的内容 */
    /* 反面的样式 */
    box-shadow: 0 0 0.3125rem 0.0625rem rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
}

.menu-image {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.inner-container,
.menu-image {
    backface-visibility: hidden;
}

.background-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.text-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateY(0deg);
    transform-style: preserve-3d;
    transition: transform 1s ease;
    -webkit-transform: translate(-50%, -50%) rotateY(0deg);
    -moz-transform: translate(-50%, -50%) rotateY(0deg);
    -ms-transform: translate(-50%, -50%) rotateY(0deg);
    -o-transform: translate(-50%, -50%) rotateY(0deg);
    h2 {
        color: aliceblue;
        font-size: 2rem;
        font-family: Mulish, "Noto Serif JP", "Noto Serif SC", Mulish,
            -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    }
}

.menu-container:hover .text-wrapper {
    transform: translate(-50%, -50%) rotateY(-180deg);
}

// 翻转部分
.inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
}

.posts {
    width: 100%;
    list-style-type: none;
    padding: 1rem;
    margin: 3rem 0 0 4rem;
    display: flex;
    flex-wrap: wrap;
    li {
        max-width: 30rem;
        // min-width: 10rem;
        flex-basis: calc(50% - 1rem);
        /* 设置初始宽度为一半，减去边距 */
        flex-grow: 1;
        /* 允许每个 li 自动调整宽度 */
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #e9546b;
        a {
            border: none;
            color: currentColor;
            outline: 0;
            text-decoration: none;
            overflow-wrap: break-word;
            word-wrap: break-word;
            transition: all 0.2s ease-in-out 0s;
            cursor: pointer;
            -webkit-transition: all 0.2s ease-in-out 0s;
            -moz-transition: all 0.2s ease-in-out 0s;
            -ms-transition: all 0.2s ease-in-out 0s;
            -o-transition: all 0.2s ease-in-out 0s;
        }
    }
}

.meta-footer {
    width: 100%;
    margin-top: auto;
    margin-left: 2rem;
    /* 将 meta-footer 推到底部 */
    padding-bottom: 1rem;
    /* 添加一些间距，可以根据需要调整 */
    display: flex;
    justify-content: space-between;
}

.meta-footer span {
    display: inline-block;
    margin-right: 1rem;
    color: #ccc;
    font-size: 0.9rem;
    /* 为 span 之间添加一些间距 */
}

.btn {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    padding: 0.5rem 1rem;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.corner-link {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 2rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    background: linear-gradient(to right, #ffcc00, #ff6699);
    border-top-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.night-mode .corner-link {
    color: #fff;
}

.ribbon {
    position: absolute;
    top: 1.5rem;
    left: 0;
    background-color: #ffcc00;
    /* 设置背景颜色 */
    color: #fff;
    /* 设置文字颜色 */
    padding: 5px 10px;
    /* 添加内边距，根据需要调整 */
    font-weight: bold;
    // transform: rotate(-45deg); /* 旋转45度，使其呈现菱形效果 */
    transform-origin: 0 100%;
    /* 设置旋转的原点为左下角 */
}

.ribbon a {
    color: #fff;
    /* 设置链接文字颜色 */
    text-decoration: none;
    /* 去除链接下划线 */
}

.night-mode .btn {
    background-color: #21252b;
    color: #ffffff;
}
